package com.github.pig.admin.model.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 部门管理
 * </p>
 *
 * @author lengleng
 * @since 2018-01-22
 */
@Data
@TableName("sys_dept")
public class SysDept extends Model<SysDept> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "dept_id")
    private Integer deptId;
    /**
     * 部门名称
     */
    private String name;
    /**
     * 排序
     */
    @TableField("order_num")
    private Integer orderNum;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 修改时间
     */
    @TableField("update_time")
    private Date updateTime;
    /**
     * 是否删除  -1：已删除  0：正常
     */
    @TableField("del_flag")
    private String delFlag;
    /**
     * 公司ID
     */
    @TableField("company_id")
    private Integer companyId;

    @TableField("parent_id")
    private Integer parentId;

    @TableField(exist = false)
    private String parentName;
    /**
     * 经营范围
     */
    @TableField("manage_range")
    private String manageRange;
    @TableField(exist = false)
    private String manageRangeName;

    @TableField("make_time")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @DateTimeFormat(pattern ="yyyy-MM-dd" )
    private Date makeTime;
    /**
     * 公司性质
     */
    @TableField("company_type")
    private String companyType;
    @TableField(exist = false)
    private String companyTypeName;
    /**
     * 公司规模
     */
    @TableField("company_scop")
    private String companyScop;
    /**
     * 自有面积
     */
    @TableField("company_own_size")
    private Double companyOwnSize;
    /**
     * 租赁面积
     */
    @TableField("company_lease_size")
    private Double companyLeaseSize;
    /**
     * 注册资金
     */
    @TableField("registered_capital")
    private Double registeredCapital;
    /**
     * 企业法人
     */
    @TableField("company_owner")
    private String companyOwner;

    @TableField("dept_property")
    private String deptProperty;
    /**
     * 社保人数
     */
    @TableField("social_security_number")
    private String socialSecurityNumber;
    /**
     * 员工数量
     */
    @TableField("employee_number")
    private Integer employeeNumber;
    @TableField(exist = false)
    private String deptPropertyName;
    private String address;
    /**
     * 企业简介
     */
    private String profiles;

    @Override
    protected Serializable pkVal() {
        return this.deptId;
    }

    @Override
    public String toString() {
        return "SysDept{" +
                ", deptId=" + deptId +
                ", name=" + name +
                ", orderNum=" + orderNum +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", delFlag=" + delFlag +
                "}";
    }
}
